<?php

/*
 * To change this template, choose Tools | Templates and open the template in the editor.
 */
if (!is_null($model)) {
    foreach ($model as $m) {
        echo "<div class='user_active' id='" . $m->id . "'>";
        echo $m->user->fullname . '<br>';
        switch ($m->active_type) {
            case UserActive::LIKE_IMG :
                echo ' Like ';
                break;
            case UserActive::COMMENT_IMG :
                echo ' Comment ';
                break;
            case UserActive::UPLOAD_IMG :
                echo ' Upload ';
                break;
            default :
                break;
        }
        echo '<br/>';
        echo '<a href="' . Yii::app()->createUrl('image/view', array(
            'id' => $m->image->id
        )) . '">' . $m->image->title . '</a><br>';
        echo $m->active_at . '<br>';
        echo '<img width="150px" src="' . Yii::app()->baseUrl . '/upload/user/' . $m->image->userCreated->id . '/images/' . $m->image->img_url . '" /><br><hr>';
        ;
        echo "</div>";
    }
} else {
    echo '<b>Bạn không có newsfeed nào.</b>';
}
?>
